﻿import { createSlice } from "@reduxjs/toolkit";

const articleSlice = createSlice({
    name: 'articles',
    initialState: {
        allArticleList: [],
        queryArticleList: []
    },
    reducers: {
        // 设置全部文章列表
        setAllArticleList: (state, action) => {
            state.allArticleList = action.payload
        },
        // 设置查询列表
        setQueryArticleList: (state, action) => {
            state.queryArticleList = action.payload
        }
    }
})

export const { setAllArticleList, setQueryArticleList } = articleSlice.actions
export default articleSlice